﻿<Page
    x:Name="pageRoot"
    x:Class="MJPEGDecoderWinRT.View.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MJPEGDecoderWinRT.View"
    xmlns:common="using:MJPEGDecoderWinRT.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    DataContext="{Binding DefaultViewModel.Root, RelativeSource={RelativeSource Self}}"    
    mc:Ignorable="d">

    <Page.Resources>
        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">MJPEG DECODER WINRT</x:String>
    </Page.Resources>

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- Page title -->
        <TextBlock Grid.Row="0"
                   x:Name="pageTitle"
                   Text="{StaticResource AppName}"
                   Style="{StaticResource HeaderTextBlockStyle}"
                   Grid.Column="1" 
                   IsHitTestVisible="false"
                   TextWrapping="NoWrap"
                   VerticalAlignment="Bottom"
                   Margin="24,0,30,40"/>
        
        <!-- Camera data -->
        <Grid Grid.Row="1"
              Width="500"
              HorizontalAlignment="Left"
              Margin="24,0,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Margin="0" >
                <TextBlock Text="Camera name" Style="{ThemeResource SubtitleTextBlockStyle}" />
                <TextBox Text="{Binding CameraName, Mode=TwoWay}"
                         InputScope="AlphanumericFullWidth"
                         Margin="0,12,0,0"/>
            </StackPanel>
            <StackPanel Grid.Row="1" Margin="0,8,0,0" >
                <TextBlock Text="Camera url"
                           Style="{ThemeResource SubtitleTextBlockStyle}" />
                <TextBox Text="{Binding CameraUri, Mode=TwoWay}"
                         TextWrapping="Wrap"
                         InputScope="AlphanumericFullWidth"
                         Margin="0,12,0,0"/>
            </StackPanel>
            <StackPanel Grid.Row="2" Margin="0,8,0,0" >
                <TextBlock Text="Camera username" Style="{ThemeResource SubtitleTextBlockStyle}" />
                <TextBox Text="{Binding CameraUserName, Mode=TwoWay}"
                         TextWrapping="Wrap"
                         InputScope="AlphanumericFullWidth"
                         Margin="0,12,0,0"/>
            </StackPanel>
            <StackPanel Grid.Row="3" Margin="0,8,0,0" >
                <TextBlock Text="Camera user password" Style="{ThemeResource SubtitleTextBlockStyle}" />
                <TextBox Text="{Binding CameraPassword, Mode=TwoWay}"
                         TextWrapping="Wrap"
                         InputScope="AlphanumericFullWidth"
                         Margin="0,12,0,0"/>
            </StackPanel>
            <StackPanel Grid.Row="4" Margin="0,8,0,0" >
                <TextBlock Text="Camera mjpeg resource path" Style="{ThemeResource SubtitleTextBlockStyle}" />
                <TextBox Text="{Binding CameraResourcePath, Mode=TwoWay}"
                         TextWrapping="Wrap"
                         InputScope="AlphanumericFullWidth"
                         Margin="0,12,0,0"/>
            </StackPanel>
        </Grid>

        <!-- Command -->
        <Button Grid.Row="2"
                Content="Show"
                Command="{Binding ShowCameraPageCmd}"
                Margin="24,8,0,0"/>

    </Grid>
</Page>
